<%= form_for(
        preferences,
        method: :patch,
        url:    (preferences.messageboard ? messageboard_preferences_path(preferences.messageboard) : global_preferences_path),
        html:   {
            class:                                'thredded--form thredded--notification-preferences-form',
            'data-thredded-user-preferences-form' => true
        }) do |f| %>

  <h3><%= t 'thredded.preferences.form.global_preferences_label' %></h3>
  <ul class="thredded--form-list">
    <li>
      <%= f.label :notify_on_message do %>
        <%= f.check_box :notify_on_message %>
        <%= t 'thredded.preferences.form.notify_on_message.label' %>
        <p class="thredded--form-list--hint">
          <%= t 'thredded.preferences.form.notify_on_message.hint' %>
        </p>
      <% end %>
    </li>
    <li>
      <%= f.label :notify_on_mention do %>
        <%= f.check_box :notify_on_mention %>
        <%= t 'thredded.preferences.form.notify_on_mention.label' %>
        <p class="thredded--form-list--hint">
          <%= t 'thredded.preferences.form.notify_on_mention.hint' %>
        </p>
      <% end %>
    </li>
  </ul>
  <% if preferences.messageboard %>
    <h3>
      <%= t 'thredded.preferences.form.messageboard_preferences_label_html', messageboard: messageboard.name %>
    </h3>
    <ul class="thredded--form-list" data-thredded-user-preferences-form-messageboard-fields>
      <li>
        <%= f.label :messageboard_notify_on_mention do %>
          <%= f.check_box :messageboard_notify_on_mention %>
          <%= t 'thredded.preferences.form.messageboard_notify_on_mention.label' %>
          <p class="thredded--form-list--hint">
            <%= t 'thredded.preferences.form.messageboard_notify_on_mention.hint' %>
          </p>
        <% end %>
      </li>
    </ul>
  <% end %>
  <button type="submit" class="thredded--form--submit">
    <%= t 'thredded.preferences.form.submit_btn' %>
  </button>
<% end %>
